using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class Lesson18work 
{
    private static Lesson18work instance =new Lesson18work();
    public static Lesson18work Instance =>instance;

   Lesson18work() { }   

    
    public void Load<T>(string name,UnityAction<T> callback) where T : Object
    {
        ResourceRequest rq=Resources.LoadAsync(name);
        rq.completed += (a)=>
        {
            callback(rq.asset as T);
            
        };
    }
   
}
